package com.jf.thread;

public class TW implements Runnable{

    private TicketPool tp = new TicketPool();

    @Override
    public void run() {
        while (true){
            int ticket = tp.getTicket();
            if(ticket<=0){
                break;
            }
            System.out.println(Thread.currentThread().getName()+"窗口剩余"+ticket);
        }
    }
}
